<?php

require('./configs/include.php');

class c_consultar_producto extends super_controller {
    
    public function consultar() {
        
        $cod['noticia']['id']= "1";			
	$options['noticia']['lvl2']="by_id";
	$this->orm->connect();
	$this->orm->read_data(array("noticia"),$options,$cod);
	$noticia = $this->orm->get_objects("noticia");
	$this->orm->close();
        
        $this->engine->assign('noticia', $noticia[0]);

    }
  
    public function display() {

        $where = array(array('name' => $this->gvar['n_consultar_noticia'], 'link' => $this->gvar['l_consultar_noticia']));
       
        $this->engine->assign('title', $this->gvar['n_consultar_noticia']);
        $this->engine->assign('active', $this->gvar['n_consultar_noticia']);
        $this->engine->assign('where', $where);
        $this->engine->display('header2.tpl');
        $this->engine->display($this->temp_aux);
        $this->engine->display('consultar_noticia.tpl');
        $this->engine->display('footer2.tpl');
    }

    public function run() {
        try {
            if (isset($this->get->option)) {
                $this->{$this->get->option}();
            }
        } catch (Exception $e) {
            $this->error = 1;
            $this->msg_warning = $e->getMessage();
            $this->temp_aux = 'message.tpl';
            $this->engine->assign('type_warning', $this->type_warning);
            $this->engine->assign('msg_warning', $this->msg_warning);
        }

        $this->display();
    }

}

$call = new c_consultar_producto();
$call->run();
?>